package edu.pku.sei.modeler.uml.commands.sequence;

import edu.pku.sei.modeler.model.core.MetaModelElement;
import edu.pku.sei.modeler.model.structure.MetaLink;
import edu.pku.sei.modeler.model.structure.MetaNode;
import edu.pku.sei.modeler.model.uml.Dependencies.Dependency;
import edu.pku.sei.modeler.model.uml.Fragments.CombinedFragment;
import edu.pku.sei.modeler.uml.commands.ConnectionModelCreateCommand;
import edu.pku.sei.modeler.uml.commands.UMLConnectionCreateCommand;

public class UMLCombinedFragmentDividerCreateCommand extends ConnectionModelCreateCommand {

	public UMLCombinedFragmentDividerCreateCommand(
			MetaModelElement connectionModel, MetaModelElement sourceModel) {
		super(connectionModel, sourceModel);
	}

	@Override
	public boolean canExecute() {
		return (sourceModel == targetModel) && sourceModel instanceof CombinedFragment;
	}
	@Override
	public void undo() {
		CombinedFragment combinedFrament = (CombinedFragment) sourceModel;
		//TODO
		//	combinedFrament.getDividers().remove(link.getModelElement());

	}

	@Override
	public void execute() {
		CombinedFragment combinedFrament = (CombinedFragment) sourceModel;
		Dependency dependency = (Dependency)connectionModel;
//        dependency.setModel(this.target.getModelElement().getModel());
		//TODO
        //combinedFrament.getDividers().add(link.getModelElement());

	}

	
	
	

}
